package com.strato.mybatis.generator.v1_2_0.project.impl;

import java.io.File;

import com.strato.mybatis.generator.v1_2_0.config.GenerateConfig;
import com.strato.mybatis.generator.v1_2_0.project.ProjectModel;

public class EclipseProjectModel implements ProjectModel {

	@Override
	public File getXmlBase(File rootDir) {
		return new File(rootDir,
				GenerateConfig.getInstance().getProperties().getProperty("project.model.eclipse.xmlBase"));
	}

	@Override
	public File getModelBase(File rootDir) {
		return new File(rootDir,
				GenerateConfig.getInstance().getProperties().getProperty("project.model.eclipse.modelBase"));
	}

	@Override
	public File getMapperBase(File rootDir) {
		return new File(rootDir,
				GenerateConfig.getInstance().getProperties().getProperty("project.model.eclipse.mapperBase"));
	}

	@Override
	public boolean isProjectRoot(File dir) {
		return new File(dir, ".project").exists();
	}

	@Override
	public String getName() {
		return "eclipse";
	}

	@Override
	public String getLabel() {
		return "Eclipse";
	}

}
